import { lazy } from "react";

import Home from '../pages/home/Index'
import Error from '../pages/404/Index'
import { Navigate } from "react-router-dom";

const Index=lazy(()=>import('../pages/index/Index'))
const User=lazy(()=>import('../pages/user/Index'))


const homee=[
    {
        path:'/home/index',
        element:<Index></Index>
    },
    {
        path:'/home/user/:id',
        element:<User></User>
    }
]


const router=[
    {
        path:'/',
        element:<Navigate to={'/home/index'}></Navigate>
    },
    {
        path:'/home',
        element:<Home></Home>,
        children:homee
    },
    {
        path:'*',
        element:<Error></Error>
    }
]
export default router





